#include "Header.inc"
#include "Rogue.inc"
.org 0
.echo "Program Start: ",$
.echo "Size: ",ProgEnd
; Executable Header
	db 0			; Size of Stack needed
ProgStart:
; End Headers Start Data
	sto(DISABLED,MultitaskEnabled)
	play(e5,wholed)
	ldrDE(_)	
	call GetFilePointer
	if(SUCCESS)
		jr nz,_Skiptxt
	inc de
	inc de
	ex de,hl
	rDrawWrappedString
_Skiptxt:
	ldrDE(++_)
	call GetFilePointer
	if(SUCCESS)
		jr nz,_Error0
	inc de
	inc de
	call NewThread
	if(SUCCESS)
		jr nz,_Error1
	sto(ENABLED,MultitaskEnabled)
	rEndThread
_Error0:
	ldrHL(++++_)
	jr _Error
_Error1:
	ldrHL(++++_)
_Error:
	push af
		call Newline
		ex de,hl
		ldrHL(+++_)
		rDrawWrappedString
		ex de,hl
		rDrawWrappedString
	pop af
	call LoadReturnText
	rDrawWrappedString
	rFastCopy
	call FlushKeys
	call WaitKey
	jp Boot
_	db "boot/boot.txt",0
_	db "boot/boot.config",0
_	db "Boot Error\n",0
_	db "Can't load config\n",0
_	db "Cant Start Thread\n",0
ProgEnd:
.echo "Program End: ",$
